#ifndef __DTD__
#define __DTD__

#include <map>
#include <string>
#include "ElementDTD.h"

class DTD
{
	private:
		std::map<string, ElementDTD*> elems;
		std::vector<AttributeDTD*> atts;
		bool validity;

	public:
		DTD();

		/** Add an element to the map of elements
            @return 0 if the element was inserted
                   -1 if the element couldn't be inserted
        **/
		int addElement(char * name, ElementDTD * e);
		void addAttribute(AttributeDTD* att);

		/**
		Try to affect each attribute with the corresponding element.
		@return -1 if there is an error (e.g two attributes with the same name associated to the same element
                0 if no error
		**/
		int makeDTD();
		void setIsValid(bool validity);
		bool isValid() const;
		ElementDTD* getElementByName(string name) const;
		virtual void display() const;
		virtual ~DTD() {}
};


#endif
